/*
 * @(#)ApplicationException.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.workflow.applet.net;

import javax.servlet.ServletException;


/**
  ApplicationException.java

  This class is to keep the application error.

    @author          Rollo Chan
    @company         DCIVision Limited
    @creation date   24/06/2003
    @version         $Revision: 1.1 $
*/

public class ApplicationException extends ServletException {

  public static final String REVISION = "$Revision: 1.1 $";

  private String msgCode;
  private String[] msgArg;
  private Exception srcException;

  /**
   * Constructor
   */
  public ApplicationException() {
    super();
  }

  /**
   * Constructor
   *
   * @param msgCode
   */
  public ApplicationException(String msgCode) {
     this(msgCode, null);
  }

  /**
   * Constructor
   *
   * @param srcException
   */
  public ApplicationException(Exception srcException) {
    this(null, srcException);
  }

  /**
   * Constructor
   *
   * @param msgCode
   * @param srcException
   */
  public ApplicationException(String msgCode, Exception srcException) {
    this(msgCode, srcException, (String[])null);
  }

  /**
   * Constructor
   *
   * @param msgCode
   * @param srcException
   * @param msgArgStr
   */
  public ApplicationException(String msgCode, Exception srcException, String msgArgStr) {
    this(msgCode, srcException, new String[]{ msgArgStr });
  }

  /**
   * Constructor
   *
   * @param msgCode
   * @param srcException
   * @param msgArg
   */
  public ApplicationException(String msgCode, Exception srcException, String[] msgArg) {
    this();
    this.msgCode = msgCode;
    this.srcException = srcException;
    this.msgArg = msgArg;
  }

  /**
   * getMsgCode
   *
   * @return the error message code
   */
  public String getMsgCode() {
    return(this.msgCode);
  }

  /**
   * getSrcException
   *
   * @return the source exception object
   */
  public Exception getSrcException() {
    return(this.srcException);
  }
}
